﻿using System.Collections.Generic;
using Microsoft.WowAddonStudio.FrameXml.Services;

namespace Microsoft.WowAddonStudio.FrameXml.Components.Editors
{
	/// <summary>
	/// Represents an element in the hierarchy.
	/// </summary>
	public abstract class PickerElement
	{
		/// <summary>
		/// Gets or sets the display name.
		/// </summary>
		/// <value>The display name.</value>
		public string DisplayName { get; private set; }

		/// <summary>
		/// Gets a value indicating whether this instance has child.
		/// </summary>
		/// <value><c>true</c> if this instance has child; otherwise, <c>false</c>.</value>
		public abstract bool HasChild { get; }

        /// <summary>
        /// Gets the type of the resource file.
        /// </summary>
        /// <value>The type of the resource file.</value>
        public ResourceFileType ResourceFileType { get; set; }

		/// <summary>
		/// Initializes a new instance of the <see cref="PickerElement"/> class.
		/// </summary>
		/// <param name="displayName">The display name.</param>
		protected PickerElement(string displayName)
		{
			DisplayName = displayName;
		}

        /// <summary>
        /// Adds the specified resource file.
        /// </summary>
        /// <param name="resourceFile">The resource file.</param>
		public abstract void Add(ResourceFile resourceFile);

		/// <summary>
		/// Gets the children.
		/// </summary>
		/// <returns></returns>
		public abstract IEnumerable<PickerElement> GetChildren { get; }

		/// <summary>
		/// Returns a <see cref="T:System.String"></see> that represents the current <see cref="T:System.Object"></see>.
		/// </summary>
		/// <returns>
		/// A <see cref="T:System.String"></see> that represents the current <see cref="T:System.Object"></see>.
		/// </returns>
		public override string ToString()
		{
			return DisplayName;
		}
	}
}
